<style lang="scss" scoped>
.sidebar {
    width: 150px;
}
.is-active{
    background-color: #fff;
}
.el-menu-item{
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    .fa-icon{
        margin-right: 5px;
        width: 20px;
        height: 20px;
    }
}
</style>
<template>
    <el-menu :default-active="active" class="sidebar" :router="true">
        <el-menu-item index="/home">
            <icon name="map-o"></icon>彩金宝
        </el-menu-item>
        <el-menu-item index="/user">
            <icon name="user-o"></icon>个人中心
        </el-menu-item>
    </el-menu>
</template>

<script>
    export default {
        data () {
            return {
                active: this.$route.path
            }
        },
        watch: {
            $route(){
                this.active = this.$route.path
            }
        }
    }
</script>